<?php 
// San pham
add_action( 'init', 'register_custom_projects' );

function register_custom_projects() {	

	$labels = array(
	    'name' 					=> _x('Dự án', 'Dự án'),
	    'singular_name' 		=> _x('Dự án', 'Dự án'),
	    'add_new' 				=> _x('Thêm mới', 'Dự án'),
	    'add_new_item' 			=> __('Dự án mới'),
	    'edit_item' 			=> __('Sửa Dự án'),
	    'new_item' 				=> __('Dự án mới'),
	    'all_items' 			=> __('Tất cả Dự án'),
	    'view_item'				=> __('Xem Dự án'),
	    'search_items'			=> __('Tìm Dự án'),
	    'not_found' 			=> __('Không tìm thất Dự án'),
	    'not_found_in_trash' 	=> __('Không tìm thất Dự án'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Dự án'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			 => array('post_tag'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('projects',$args);	
	  
}


##=============================================================================================

add_action( 'init', 'register_custom_news_event' );
function register_custom_news_event() 
{	

	$labels = array(
	    'name' 					=> _x('Tin tức', 'Tin tức'),
	    'singular_name' 		=> _x('Tin tức', 'Tin tức'),
	    'add_new' 				=> _x('Thêm mới', 'Tin tức'),
	    'add_new_item' 			=> __('Thêm mới Tin tức'),
	    'edit_item' 			=> __('Sửa Tin tức'),
	    'new_item' 				=> __('Tin tức mới'),
	    'all_items' 			=> __('Tất cả Tin tức'),
	    'view_item'				=> __('Xem Tin tức'),
	    'search_items'			=> __('Tìm Tin tức'),
	    'not_found' 			=> __('Không tìm thấy Tin tức'),
	    'not_found_in_trash' 	=> __('Không tìm thấy Tin tức'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Tin tức'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			 => array('post_tag'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('news-event',$args);
	  ## post_tag for page
	  register_taxonomy_for_object_type('post_tag', 'page');	  	
}

##=============================================================================================
add_action( 'init', 'register_custom_out_ykien' );
function register_custom_out_ykien() 
{	

	$labels = array(
	    'name' 					=> _x('Khách hàng', 'Khách hàng'),
	    'singular_name' 		=> _x('Khách hàng', 'Khách hàng'),
	    'add_new' 				=> _x('Thêm mới', 'Khách hàng'),
	    'add_new_item' 			=> __('Thêm mới Khách hàng'),
	    'edit_item' 			=> __('Sửa Khách hàng'),
	    'new_item' 				=> __('Khách hàng mới'),
	    'all_items' 			=> __('Tất cả Khách hàng'),
	    'view_item'				=> __('Xem Khách hàng'),
	    'search_items'			=> __('Tìm Khách hàng'),
	    'not_found' 			=> __('Không tìm thấy Khách hàng'),
	    'not_found_in_trash' 	=> __('Không tìm thất Khách hàng'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Khách hàng'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			 => array('category'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('testimonials',$args);	
}
##=============================================================================================

add_action( 'init', 'register_custom_out_service' );
function register_custom_out_service() 
{	

	$labels = array(
	    'name' 					=> _x('Dịch vụ', 'Dịch vụ'),
	    'singular_name' 		=> _x('Dịch vụ', 'Dịch vụ'),
	    'add_new' 				=> _x('Thêm mới', 'Dịch vụ'),
	    'add_new_item' 			=> __('Thêm mới Dịch vụ'),
	    'edit_item' 			=> __('Sửa Dịch vụ'),
	    'new_item' 				=> __('Dịch vụ mới'),
	    'all_items' 			=> __('Tất cả Dịch vụ'),
	    'view_item'				=> __('Xem Dịch vụ'),
	    'search_items'			=> __('Tìm Dịch vụ'),
	    'not_found' 			=> __('Không tìm thấy Dịch vụ'),
	    'not_found_in_trash' 	=> __('Không tìm thấy Dịch vụ'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Dịch vụ'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			 => array('post_tag'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('services',$args);	
}

##=============================================================================================

//add_action( 'init', 'register_custom_adv_image' );
function register_custom_adv_image() 
{	

	$labels = array(
	    'name' 					=> _x('Gallerys', 'Gallerys'),
	    'singular_name' 		=> _x('Gallerys', 'Gallerys'),
	    'add_new' 				=> _x('Add new', 'Gallerys'),
	    'add_new_item' 			=> __('Adv New Gallerys'),
	    'edit_item' 			=> __('Edit Gallerys'),
	    'new_item' 				=> __('New Gallerys'),
	    'all_items' 			=> __('All Gallerys'),
	    'view_item'				=> __('View Gallerys'),
	    'search_items'			=> __('Search Gallerys'),
	    'not_found' 			=> __('Not found Gallerys'),
	    'not_found_in_trash' 	=> __('Not found Gallerys'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Gallerys'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	'taxonomies'			 => array('show-on-page'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title')
	  ); 
	  register_post_type('gallerys',$args);	
}

##=============================================================================================


//add_action( 'init', 'register_custom_banner' );
function register_custom_banner() {	

	$labels = array(
	    'name' 					=> _x('Banner', 'Banner'),
	    'singular_name' 		=> _x('Banner', 'Banner'),
	    'add_new' 				=> _x('Add new', 'Banner'),
	    'add_new_item' 			=> __('Add new Banner'),
	    'edit_item' 			=> __('Edit Banner'),
	    'new_item' 				=> __('New Banner'),
	    'all_items' 			=> __('All Banner'),
	    'view_item'				=> __('View Banner'),
	    'search_items'			=> __('Search Banner'),
	    'not_found' 			=> __('Not found Banner'),
	    'not_found_in_trash' 	=> __('Not found Banner'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Banner'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			=> array('show-on-page'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title')
	  ); 
	  register_post_type('banner',$args);	
}

##=============================================================================================

##=============================================================================================


add_action( 'init', 'register_custom_slideshow' );
function register_custom_slideshow()
{	

	$labels = array(
	    'name' 					=> _x('Slide Show', 'Slide Show'),
	    'singular_name' 		=> _x('Slide Show', 'Slide Show'),
	    'add_new' 				=> _x('Add new', 'Slide Show'),
	    'add_new_item' 			=> __('Add new Slide Show'),
	    'edit_item' 			=> __('Edit Slide Show'),
	    'new_item' 				=> __('New Slide Show'),
	    'all_items' 			=> __('All Slide Show'),
	    'view_item'				=> __('View Slide Show'),
	    'search_items'			=> __('Search Slide Show'),
	    'not_found' 			=> __('Not found Slide Show'),
	    'not_found_in_trash' 	=> __('Not found Slide Show'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Slide Show'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			 => array('category'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title')
	  ); 
	  register_post_type('slide-show',$args);	
}



//add_action( 'init', 'register_image_testimonial' );
function register_image_testimonial() {	

	$labels = array(
	    'name' 					=> _x('Testimonial', 'Testimonial'),
	    'singular_name' 		=> _x('Testimonial', 'Testimonial'),
	    'add_new' 				=> _x('Add new', 'Testimonial'),
	    'add_new_item' 			=> __('Add new Testimonial'),
	    'edit_item' 			=> __('Edit Testimonial'),
	    'new_item' 				=> __('New Testimonial'),
	    'all_items' 			=> __('All Testimonial'),
	    'view_item'				=> __('View Testimonial'),
	    'search_items'			=> __('Search Testimonial'),
	    'not_found' 			=> __('Not found Testimonial'),
	    'not_found_in_trash' 	=> __('Not found Testimonial'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Testimonial'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	    //'taxonomies'			 => array('muc-slide-show'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('testimonial',$args);	
}

//add_action( 'init', 'register_image_ticket' );
function register_image_ticket() {	

	$labels = array(
	    'name' 					=> _x('Tichket', 'Tichket'),
	    'singular_name' 		=> _x('Tichket', 'Tichket'),
	    'add_new' 				=> _x('Add new', 'Tichket'),
	    'add_new_item' 			=> __('Add new Tichket'),
	    'edit_item' 			=> __('Edit Tichket'),
	    'new_item' 				=> __('New Tichket'),
	    'all_items' 			=> __('All Tichket'),
	    'view_item'				=> __('View Tichket'),
	    'search_items'			=> __('Search Tichket'),
	    'not_found' 			=> __('Not found Tichket'),
	    'not_found_in_trash' 	=> __('Not found Tichket'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Ticket'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	    'taxonomies'			 => array('category-ticket'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('ticket',$args);	
}

//add_action( 'init', 'register_image_newpage' );
function register_image_newpage() {	

	$labels = array(
	    'name' 					=> _x('My Page', 'My Page'),
	    'singular_name' 		=> _x('My Page', 'My Page'),
	    'add_new' 				=> _x('Add new', 'My Page'),
	    'add_new_item' 			=> __('Add new My Page'),
	    'edit_item' 			=> __('Edit My Page'),
	    'new_item' 				=> __('New My Page'),
	    'all_items' 			=> __('All My Page'),
	    'view_item'				=> __('View My Page'),
	    'search_items'			=> __('Search My Page'),
	    'not_found' 			=> __('Not found My Page'),
	    'not_found_in_trash' 	=> __('Not found My Page'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'My Page'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'page',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	    //'taxonomies'			 => array('category-ticket'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('my-page',$args);	
}
##=============================================================================================


function my_feed_request($qv) {
	    if (isset($qv['feed']) && !isset($qv['post_type']))
	        $qv['post_type'] = array('post','projects','news-event','services');
	    return $qv;
	}
add_filter('request', 'my_feed_request');
?>